package cn.gok;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;

public class 大数运算 {
    public static void main(String[] args) {
        //test();
        test1();
    }

    private static void test1() {
        BigInteger b1 = new BigInteger("123456789");
        BigInteger b2 = new BigInteger("10");
        BigInteger divide = b1.divide(b2);
        System.out.println(divide);
    }

    private static void test() {
        double d = 123456789.45;
        BigDecimal b1 = new BigDecimal(d);
        BigDecimal b2 = new BigDecimal(10);
        //保留两位并且四舍五入
        BigDecimal divide = b1.divide(b2, 2, RoundingMode.HALF_UP);
        System.out.println(divide);
    }

}
